package org.agilelang.object;

/*
 AgileLang - A fourth generation language(http://www.agilelang.org).

 Copyright (C) 2013 Roderick Cusirramos (roderick20@hotmail.com)

 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import org.agilelang.object.attributes.Attribute;
import org.agilelang.object.attributes.AttributeVirtual;
import org.agilelang.object.attributes.Reference;

@XmlRootElement(name = "model")
public class Model implements Serializable {

    @XmlAttribute
    public String name = "";
    public String caption = "";
    public String table = "";
    public String description = "";
    public String options = "";
    
    
    @XmlElement(name = "attribute")
    public List<Attribute> attributes = new ArrayList<Attribute>();
    
    @XmlElement(name = "attributevirtual")
    public List<AttributeVirtual> attribute_virtual = new ArrayList<AttributeVirtual>();
    
    @XmlElement(name = "reference")
    public List<Reference> references = new ArrayList<Reference>();

    public void addAttributeVirtual(AttributeVirtual attribute) {
        this.attribute_virtual.add(attribute);
    }

    public void setAttributeVirtuals(List<AttributeVirtual> attributes) {
        this.attribute_virtual = attributes;
    }
    
    public void addAttribute(Attribute attribute) {
        this.attributes.add(attribute);
    }

    public void setAttributes(List<Attribute> attributes) {
        this.attributes = attributes;
    }

    public void addReference(Reference references) {
        this.references.add(references);
    }

    public void setReferences(List<Reference> references) {
        this.references = references;
    }
}
